var app = {
    // Application Constructor
    initialize: function() {
        this.bindEvents();
    },
    // Bind Event Listeners
    //
    // Bind any events that are required on startup. Common events are:
    // 'load', 'deviceready', 'offline', and 'online'.
    bindEvents: function() {
        document.addEventListener('deviceready', this.onDeviceReady, false);
    },
    // deviceready Event Handler
    //
    // The scope of 'this' is the event. In order to call the 'receivedEvent'
    // function, we must explicitly call 'app.receivedEvent(...);'
    onDeviceReady: function() {
            var $page1_content = $("#page-1 .content");
            $page1_content.append($("<p>" + "name : " + device.name + "</p>"));
            $page1_content.append($("<p>" + "model : " + device.model + "</p>"));
            $page1_content.append($("<p>" + "cordova : " + device.cordova + "</p>"));
            $page1_content.append($("<p>" + "platform : " + device.platform + "</p>"));
            $page1_content.append($("<p>" + "uuid : " + device.uuid + "</p>"));
            $page1_content.append($("<p>" + "version : " + device.version + "</p>"));
            window.requestFileSystem(LocalFileSystem.PERSISTENT, 0, function(fileSystem) {
                $page1_content.append($("<p>" + "fileSystem name : " + fileSystem.name + "</p>"));
                $page1_content.append($("<p>" + "fileSystem root name : " + fileSystem.root.name + "</p>"));
            }, function(evt) {
                console.log(evt.target.error.code);
            });
            //app.receivedEvent('deviceready');
        }
        // Update DOM on a Received Event
        // receivedEvent: function(id) {
        //console.log('Received Event: ');
        // }
};

app.initialize();
